package com.tjn.string_;

/**
 * @author 陶镓妮
 * @version 1.0
 */
public class StringBufferExercise {
    public static void main(String[] args) {
        String price = "54786326.99";
        StringBuffer sb = new StringBuffer(price);

        for (int i = sb.indexOf(".")-3; i > 0; i-=3) {
            sb = sb.insert(i,",");
        }
        System.out.println(sb);
    }
}
